<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="umsroot.css">
<TITLE>
Syntax Differences between ECLiPSe and other Prologs
</TITLE>
</HEAD>
<BODY >
<A HREF="umsroot142.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot139.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot144.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc313">A.4</A>&nbsp;&nbsp;Syntax Differences between ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> and other Prologs</H2>
<A NAME="syntaxdiff"></A>
<A NAME="@default1202"></A>
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> supports the following extensions of Prolog syntax:
<UL CLASS="itemize"><LI CLASS="li-itemize">
Attributed variables: <CODE>X{Attr}</CODE>
<LI CLASS="li-itemize">Rational numbers: <CODE>3_4</CODE>
<LI CLASS="li-itemize">Bounded real numbers: <CODE>1.99__2.01</CODE>
<LI CLASS="li-itemize">Array subscripts: <CODE>Matrix[3,4]</CODE>
<LI CLASS="li-itemize">Structures with named fields: <CODE>emp{age:33,salary:33000}</CODE>
<LI CLASS="li-itemize">Binary prefix operators: <CODE>some X p(X)</CODE>
</UL>
Some of these extensions can be disabled via syntax option settings
(this is done for example by the compatibility packages).
In addition to the above extensions, the following minor differences
exist between default ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> syntax and most Prolog systems:
<UL CLASS="itemize"><LI CLASS="li-itemize">
In ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>, end of file is accepted as fullstop<BR>
<BR>
<LI CLASS="li-itemize">By default, an unquoted vertical bar can be used as an atom or
 functor (controlled by the syntax option <B>bar_is_no_atom</B>).<BR>
<BR>
<LI CLASS="li-itemize">By default, operators with precedence higher than 1000 are allowed
 in a comma-separated list of terms, i.e. structure arguments
 and lists. The ambiguity is resolved by considering commas
 as argument separators rather than operators inside the term.
 Thus e.g.
<PRE CLASS="verbatim">
p(a :- b, c)
</PRE>is accepted and parsed as <B>p/2</B>. This behaviour can be disabled
 (and turned into a syntax error) by setting the syntax option
 <B>limit_arg_precedence</B>.<BR>
<BR>
<LI CLASS="li-itemize">By default, double-quoted items are parsed as strings, not as character
 lists. This behaviour can be changed via
 <A HREF="../bips/kernel/syntax/set_chtab-2.html"><B>set_chtab/2</B></A><A NAME="@default1203"></A>
 which allows string-quotes, list-quotes and atom-quotes to be redefined.<BR>
<BR>
<LI CLASS="li-itemize">By default, consecutive string- or list-quotes have the effect of
 concatenating the quoted items, while consecutive atom-quotes have
 no special meaning. The syntax option <B>doubled_quote_is_quote</B>
 changes this.<BR>
<BR>
<LI CLASS="li-itemize">By default, blank space between a sign and a number is significant:
 When there is no space between sign and number, the sign is taken as
 part of the number. With space, the sign is taken as prefix operator.
 This is controlled by the syntax option <B>blanks_after_sign</B>.
</UL>
<HR>
<A HREF="umsroot142.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot139.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot144.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
